<template>
	<view>
		<button class="cu-btn line-orange" @click="handelUpload">通过nodejs上传图片</button>
	</view>
</template>

<script setup lang="ts">
const handelUpload = ()=>{
	uni.chooseImage({
		success:(file)=>{
			let temp = file.tempFilePaths[0]
			uni.uploadFile({
				url:'http://1.95.51.46:3000/upload',
				filePath:temp,
				name:'avatar',
				success:(res)=>{
					console.log(res);
				}
			})
		}
	})
}
</script>

<style lang="scss">

</style>
